#pragma once
#include "Report.h"
#include "UpgraDev.h"
#include "UsbHid.h"

#define	MAX_ACC			1200

class Upgrade;

class PebDev:public UsbHid{
private:
	static HPEN		penR,penG,penB,penW;
	static UsbHid*	create(HDEVINFO,SP_DEVICE_INTERFACE_DATA*);

	short		accidx,accx[MAX_ACC],accy[MAX_ACC],accz[MAX_ACC];
	ushort		imgIdx,imgMax,imgMin,imgPtr;
	Report		report;
	uint		curSteps,ystSteps;
	uint		tick;
	uint		offset;
	UpgraDev	upgrade;
	ushort		upgord;
	ushort		version;
	ushort		voltS;
	ushort		voltC;

	PebDev	(HDEVINFO,SP_DEVICE_INTERFACE_DATA*);

	void	drawAcc		(void);
	void	multiple	(void);
	void	sendReport	(Report*);
	void	single		(ushort,ushort);
	uint	threadEntry	(void);

public:
	static void	cleanup		(void);
	static void	openAll		(void);
};